package com.zx.feign.client.fallback;

import com.zx.core.wrapper.ObjectWrapper;
import com.zx.feign.client.SystemClient;
import com.zx.feign.client.dto.GetLoginUserResponseDTO;
import com.zx.feign.client.dto.GetSysUserResponseDTO;
import org.springframework.stereotype.Component;

/**
 * <p>
 * description: 降级处理 <br>
 * create: 2024-03-14 15:28 <br>
 * </p>
 *
 * @author zhou  xun
 */
@Component
public class FallbackSystemClient implements SystemClient {
    @Override
    public ObjectWrapper<GetLoginUserResponseDTO> getUserInfo(String userName) {
        ObjectWrapper<GetLoginUserResponseDTO> response = new ObjectWrapper<>();
        response.fail("getUserInfo远程调用被限流或降级了");
        return response;
    }

    @Override
    public ObjectWrapper<GetSysUserResponseDTO> getUserInfoById(String userId) {
        ObjectWrapper<GetSysUserResponseDTO> response = new ObjectWrapper<>();
        response.fail("getUserInfoById远程调用被限流或降级了");
        return response;
    }
}
